24. Notebook + 练习: 自助法
自助法
所以你可能没有注意到在这节课中已经使用过自助法抽样了,在之前二项式事件和掷骰子课程中也使用过。实际上,如果你抛硬币是正面或掷骰子出现 6,你可以继续抛掷得到这些数值,表明选中后还可以放回。
为了更清楚一些,你可以在 Notebook 中使用自助抽样完成一些任务,包括放回抽样的一些任务。
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: jupyter
- Opened files (when workspace is loaded): n/a
SOLUTION:
- 抽样是自助抽样的例子。
SOLUTION:
- 代码被打断。
- `replace=False` 部分导致我们无法从仅有的 6 个数值中选择 20 次。
- 这是不放回抽样的例子。